/*
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-06-01 12:05:10
 * @LastEditors: voanit
 * @LastEditTime: 2022-06-01 16:27:55
 */
import { LoginAction } from '@/types/store'
import { Token } from '@/types/data'
import { getToken } from '@/utils/storage'
const initialState: Token = getToken() || {
  token: '',
  refresh_token: ''
}
const login = (state = initialState, action: LoginAction) => {
  switch (action.type) {
    case 'login/token':
      return action.payload
    default:
      return state
  }
}

export default login